#version 320 es
layout (location = 0) in vec3 inPos;
layout (location = 1) in vec2 inUV;
layout (location = 2) in mat4 instanceMatrix;
layout (location = 6) uniform mat4 CameraVPMatrix;

struct ParticleStructure
{
    vec4 pos;
    vec4 vec;
};

layout (std140, binding = 7) buffer ParticleBuffer {
    ParticleStructure Particle[];
};

struct VSOut
{
    vec2 uv;
};

out VSOut vsout;

void main()
{
    // gl_Position = CameraVPMatrix * instanceMatrix * vec4(inPos + Particle[gl_InstanceID].pos.xyz, 1.0);
    gl_Position = CameraVPMatrix * vec4(inPos + Particle[gl_InstanceID].pos.xyz, 1.0);
    vsout.uv = inUV;
}